Play Counter by Daniel Stelzer

(for Glulx only)

"Allows an author to check how many times their story has been played."

Error

Includes and Included by are omitted for modules with errors

ni

++ 0% (Reading text)
++ 5% (Analysing sentences)
++ 15% (Drawing inferences)
++ 20% (Binding rulebooks)
++ 23% (Binding rulebooks)
++ 26% (Binding rulebooks)
++ 29% (Binding rulebooks)
++ 32% (Binding rulebooks)
++ 35% (Binding rulebooks)
++ 38% (Binding rulebooks)
++ 41% (Generating code)


You wrote 'select row 2 in the Table of Play Count' play
counter by daniel stelzer: but this is a phrase which I don't recognise,
possibly because it is one you meant to define but never got round to, or
because the wording is wrong (see the Phrasebook section of the Index to
check). Alternatively, it may be that the text immediately previous to this
was a definition whose ending, normally a full stop, is missing?


You wrote 'select row 3 in the Table of Play Count' play
counter by daniel stelzer: again, this is a phrase which I don't recognise.
++ 44% (Generating code)


You wrote 'select row 1 in the Table of Play Count' play
counter by daniel stelzer: again, this is a phrase which I don't recognise.
++ 47% (Generating code)
++ 50% (Generating code)
++ 53% (Generating code)
++ 56% (Generating code)
++ 59% (Generating code)
++ 62% (Generating code)
++ 65% (Generating code)
++ 68% (Generating code)
++ 71% (Generating code)
++ 74% (Generating code)
++ 77% (Generating code)
++ 80% (Generating code)
++ 83% (Generating code)
++ 86% (Generating code)
++ 89% (Generating code)
++ Ended: Translation failed: 3 problems found
Copy Include Play Counter by Daniel Stelzer to clipboard Include Play Counter by Daniel Stelzer.
To use this extension, you must add a line to your story defining the filename to use.

The File of Play Count is called "YOURSTORYTITLEplaycount".

(Replace YOURSTORYTITLE with your title.)

Then you can check how many times the story has been played by referring to "the play count" (which is incremented whenever the story is started and goes past the first move), "the ending count" (which is incremented whenever the story ends), and "the final ending count" (which is incremented whenever the story ends finally).
Play Counter (for Glulx only) by Daniel Stelzer begins here.

"Allows an author to check how many times their story has been played."

Table of Play Count
count
0 [play count]
0 [ending count]
0 [final ending count]

To decide which number is the play count:
   select row 1 in the Table of Play Count;
   decide on the count entry.
To decide which number is the ending count:
   select row 2 in the Table of Play Count;
   decide on the count entry.
To decide which number is the final ending count:
   select row 3 in the Table of Play Count;
   decide on the count entry.

To read count data:
   read the File of Play Count into the Table of Play Count.
To write count data:
   write the File of Play Count from the Table of Play Count.

When play begins:
   read count data.

The first-turn flag is initially true.
After doing anything:
   now the first-turn flag is false;
   select row 1 in the Table of Play Count;
   increment the count entry;
   write count data;
   continue the action.

When play ends:
   select row 2 in the Table of Play Count;
   increment the count entry;
   if the story has ended finally:
     select row 3 in the Table of Play Count;
     increment the count entry;
   write count data.

Play Counter ends here.